﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using CMS;
using Model.Entities;
namespace Winter
{
    // Note: For instructions on enabling IIS6 or IIS7 classic mode, 
    // visit http://go.microsoft.com/?LinkId=9394801

    public class MvcApplication : CmsApplication
    {

        protected void Application_Start()
        {

            string strPathFile = "Settings/Module/ModuleSetting.xml";
            string strPath = Server.MapPath(strPathFile);
            ModuleCollection.Import(strPath);   
            

            //string themePath = "Settings/Theme/PortalTheme.xml";
            //ThemeCollection.Import(Server.MapPath(themePath));

            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new CMSViewEngine());
            RegisterRoutes(RouteTable.Routes);
        }
        private void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        }
    }
}